#ifndef _ASPRITE_H_
#define _ASPRITE_H_

#include <stdlib.h>
#include <stdarg.h>

#include "sprite.h"
#include "video-graphics.h"

/** @defgroup animsprite AnimSprite
* @{
*
* Animated Sprite related functions
*/

/** An Animated Sprite is a "sub-classing" of Sprites
*  where each Sprite is manipulated using Sprite functions
*/
typedef struct {
	Sprite *sp;		///< pointer to first Sprite, the one with overall properties
	int aspeed;		///< animation speed 
	int cur_aspeed; ///< current animation speed 
	int num_fig; 	///< number of pixmaps 
	int cur_fig; 	///< current pixmap 
	char **map;     ///< pointer to array of each AnimSprite pixmaps
} AnimSprite;

/** Create an Animated Sprite from multiple pixmaps
*   At least one pixmap must be specified.
*/
AnimSprite * create_asprite(char *base, int x, int y, char *pic1[], ...);

/** Animate an Animated Sprite
*/
int animate_asprite(AnimSprite *fig, char *base, int back, int type);

/** Destroy an Animated Sprite from video memoty and
* release all resources allocated.
*/
void destroy_asprite(AnimSprite *fig, char *base);

/** @} end of sprite */

#endif
